\(\int \sqrt {x} \sqrt {a-b x} \, dx\) [499]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 77 \[ \int \sqrt {x} \sqrt {a-b x} \, dx=-\frac {a \sqrt {x} \sqrt {a-b x}}{4 b}+\frac {1}{2} x^{3/2} \sqrt {a-b x}+\frac {a^2 \arctan \left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a-b x}}\right )}{4 b^{3/2}} \]

[Out]

1/4*a^2*arctan(b^(1/2)*x^(1/2)/(-b*x+a)^(1/2))/b^(3/2)+1/2*x^(3/2)*(-b*x+a)^(1/2)-1/4*a*x^(1/2)*(-b*x+a)^(1/2)
/b

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {52, 65, 223, 209} \[ \int \sqrt {x} \sqrt {a-b x} \, dx=\frac {a^2 \arctan \left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a-b x}}\right )}{4 b^{3/2}}+\frac {1}{2} x^{3/2} \sqrt {a-b x}-\frac {a \sqrt {x} \sqrt {a-b x}}{4 b} \]

[In]

Int[Sqrt[x]*Sqrt[a - b*x],x]

[Out]

-1/4*(a*Sqrt[x]*Sqrt[a - b*x])/b + (x^(3/2)*Sqrt[a - b*x])/2 + (a^2*ArcTan[(Sqrt[b]*Sqrt[x])/Sqrt[a - b*x]])/(
4*b^(3/2))

Rule 52

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + n + 1))), x] + Dist[n*((b*c - a*d)/(b*(m + n + 1))), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} x^{3/2} \sqrt {a-b x}+\frac {1}{4} a \int \frac {\sqrt {x}}{\sqrt {a-b x}} \, dx \\ & = -\frac {a \sqrt {x} \sqrt {a-b x}}{4 b}+\frac {1}{2} x^{3/2} \sqrt {a-b x}+\frac {a^2 \int \frac {1}{\sqrt {x} \sqrt {a-b x}} \, dx}{8 b} \\ & = -\frac {a \sqrt {x} \sqrt {a-b x}}{4 b}+\frac {1}{2} x^{3/2} \sqrt {a-b x}+\frac {a^2 \text {Subst}\left (\int \frac {1}{\sqrt {a-b x^2}} \, dx,x,\sqrt {x}\right )}{4 b} \\ & = -\frac {a \sqrt {x} \sqrt {a-b x}}{4 b}+\frac {1}{2} x^{3/2} \sqrt {a-b x}+\frac {a^2 \text {Subst}\left (\int \frac {1}{1+b x^2} \, dx,x,\frac {\sqrt {x}}{\sqrt {a-b x}}\right )}{4 b} \\ & = -\frac {a \sqrt {x} \sqrt {a-b x}}{4 b}+\frac {1}{2} x^{3/2} \sqrt {a-b x}+\frac {a^2 \tan ^{-1}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a-b x}}\right )}{4 b^{3/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.20 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.97 \[ \int \sqrt {x} \sqrt {a-b x} \, dx=\frac {\sqrt {x} \sqrt {a-b x} (-a+2 b x)}{4 b}+\frac {a^2 \arctan \left (\frac {\sqrt {b} \sqrt {x}}{-\sqrt {a}+\sqrt {a-b x}}\right )}{2 b^{3/2}} \]

[In]

Integrate[Sqrt[x]*Sqrt[a - b*x],x]

[Out]

(Sqrt[x]*Sqrt[a - b*x]*(-a + 2*b*x))/(4*b) + (a^2*ArcTan[(Sqrt[b]*Sqrt[x])/(-Sqrt[a] + Sqrt[a - b*x])])/(2*b^(
3/2))

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.01

method result size
risch \(-\frac {\left (-2 b x +a \right ) \sqrt {x}\, \sqrt {-b x +a}}{4 b}+\frac {a^{2} \arctan \left (\frac {\sqrt {b}\, \left (x -\frac {a}{2 b}\right )}{\sqrt {-b \,x^{2}+a x}}\right ) \sqrt {x \left (-b x +a \right )}}{8 b^{\frac {3}{2}} \sqrt {x}\, \sqrt {-b x +a}}\) \(78\)
default \(-\frac {\sqrt {x}\, \left (-b x +a \right )^{\frac {3}{2}}}{2 b}+\frac {a \left (\sqrt {x}\, \sqrt {-b x +a}+\frac {a \sqrt {x \left (-b x +a \right )}\, \arctan \left (\frac {\sqrt {b}\, \left (x -\frac {a}{2 b}\right )}{\sqrt {-b \,x^{2}+a x}}\right )}{2 \sqrt {-b x +a}\, \sqrt {x}\, \sqrt {b}}\right )}{4 b}\) \(89\)

[In]

int(x^(1/2)*(-b*x+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/4*(-2*b*x+a)/b*x^(1/2)*(-b*x+a)^(1/2)+1/8*a^2/b^(3/2)*arctan(b^(1/2)*(x-1/2*a/b)/(-b*x^2+a*x)^(1/2))*(x*(-b
*x+a))^(1/2)/x^(1/2)/(-b*x+a)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.53 \[ \int \sqrt {x} \sqrt {a-b x} \, dx=\left [-\frac {a^{2} \sqrt {-b} \log \left (-2 \, b x + 2 \, \sqrt {-b x + a} \sqrt {-b} \sqrt {x} + a\right ) - 2 \, {\left (2 \, b^{2} x - a b\right )} \sqrt {-b x + a} \sqrt {x}}{8 \, b^{2}}, -\frac {a^{2} \sqrt {b} \arctan \left (\frac {\sqrt {-b x + a}}{\sqrt {b} \sqrt {x}}\right ) - {\left (2 \, b^{2} x - a b\right )} \sqrt {-b x + a} \sqrt {x}}{4 \, b^{2}}\right ] \]

[In]

integrate(x^(1/2)*(-b*x+a)^(1/2),x, algorithm="fricas")

[Out]

[-1/8*(a^2*sqrt(-b)*log(-2*b*x + 2*sqrt(-b*x + a)*sqrt(-b)*sqrt(x) + a) - 2*(2*b^2*x - a*b)*sqrt(-b*x + a)*sqr
t(x))/b^2, -1/4*(a^2*sqrt(b)*arctan(sqrt(-b*x + a)/(sqrt(b)*sqrt(x))) - (2*b^2*x - a*b)*sqrt(-b*x + a)*sqrt(x)
)/b^2]

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 4.63 (sec) , antiderivative size = 207, normalized size of antiderivative = 2.69 \[ \int \sqrt {x} \sqrt {a-b x} \, dx=\begin {cases} \frac {i a^{\frac {3}{2}} \sqrt {x}}{4 b \sqrt {-1 + \frac {b x}{a}}} - \frac {3 i \sqrt {a} x^{\frac {3}{2}}}{4 \sqrt {-1 + \frac {b x}{a}}} - \frac {i a^{2} \operatorname {acosh}{\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}} \right )}}{4 b^{\frac {3}{2}}} + \frac {i b x^{\frac {5}{2}}}{2 \sqrt {a} \sqrt {-1 + \frac {b x}{a}}} & \text {for}\: \left |{\frac {b x}{a}}\right | > 1 \\- \frac {a^{\frac {3}{2}} \sqrt {x}}{4 b \sqrt {1 - \frac {b x}{a}}} + \frac {3 \sqrt {a} x^{\frac {3}{2}}}{4 \sqrt {1 - \frac {b x}{a}}} + \frac {a^{2} \operatorname {asin}{\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}} \right )}}{4 b^{\frac {3}{2}}} - \frac {b x^{\frac {5}{2}}}{2 \sqrt {a} \sqrt {1 - \frac {b x}{a}}} & \text {otherwise} \end {cases} \]

[In]

integrate(x**(1/2)*(-b*x+a)**(1/2),x)

[Out]

Piecewise((I*a**(3/2)*sqrt(x)/(4*b*sqrt(-1 + b*x/a)) - 3*I*sqrt(a)*x**(3/2)/(4*sqrt(-1 + b*x/a)) - I*a**2*acos
h(sqrt(b)*sqrt(x)/sqrt(a))/(4*b**(3/2)) + I*b*x**(5/2)/(2*sqrt(a)*sqrt(-1 + b*x/a)), Abs(b*x/a) > 1), (-a**(3/
2)*sqrt(x)/(4*b*sqrt(1 - b*x/a)) + 3*sqrt(a)*x**(3/2)/(4*sqrt(1 - b*x/a)) + a**2*asin(sqrt(b)*sqrt(x)/sqrt(a))
/(4*b**(3/2)) - b*x**(5/2)/(2*sqrt(a)*sqrt(1 - b*x/a)), True))

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.23 \[ \int \sqrt {x} \sqrt {a-b x} \, dx=-\frac {a^{2} \arctan \left (\frac {\sqrt {-b x + a}}{\sqrt {b} \sqrt {x}}\right )}{4 \, b^{\frac {3}{2}}} + \frac {\frac {\sqrt {-b x + a} a^{2} b}{\sqrt {x}} - \frac {{\left (-b x + a\right )}^{\frac {3}{2}} a^{2}}{x^{\frac {3}{2}}}}{4 \, {\left (b^{3} - \frac {2 \, {\left (b x - a\right )} b^{2}}{x} + \frac {{\left (b x - a\right )}^{2} b}{x^{2}}\right )}} \]

[In]

integrate(x^(1/2)*(-b*x+a)^(1/2),x, algorithm="maxima")

[Out]

-1/4*a^2*arctan(sqrt(-b*x + a)/(sqrt(b)*sqrt(x)))/b^(3/2) + 1/4*(sqrt(-b*x + a)*a^2*b/sqrt(x) - (-b*x + a)^(3/
2)*a^2/x^(3/2))/(b^3 - 2*(b*x - a)*b^2/x + (b*x - a)^2*b/x^2)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 166 vs. \(2 (55) = 110\).

Time = 156.00 (sec) , antiderivative size = 166, normalized size of antiderivative = 2.16 \[ \int \sqrt {x} \sqrt {a-b x} \, dx=\frac {\frac {4 \, {\left (\frac {a b \log \left ({\left | -\sqrt {-b x + a} \sqrt {-b} + \sqrt {{\left (b x - a\right )} b + a b} \right |}\right )}{\sqrt {-b}} - \sqrt {{\left (b x - a\right )} b + a b} \sqrt {-b x + a}\right )} a {\left | b \right |}}{b^{2}} - \frac {{\left (\frac {3 \, a^{2} b \log \left ({\left | -\sqrt {-b x + a} \sqrt {-b} + \sqrt {{\left (b x - a\right )} b + a b} \right |}\right )}{\sqrt {-b}} - \sqrt {{\left (b x - a\right )} b + a b} {\left (2 \, b x + 3 \, a\right )} \sqrt {-b x + a}\right )} {\left | b \right |}}{b^{2}}}{4 \, b} \]

[In]

integrate(x^(1/2)*(-b*x+a)^(1/2),x, algorithm="giac")

[Out]

1/4*(4*(a*b*log(abs(-sqrt(-b*x + a)*sqrt(-b) + sqrt((b*x - a)*b + a*b)))/sqrt(-b) - sqrt((b*x - a)*b + a*b)*sq
rt(-b*x + a))*a*abs(b)/b^2 - (3*a^2*b*log(abs(-sqrt(-b*x + a)*sqrt(-b) + sqrt((b*x - a)*b + a*b)))/sqrt(-b) -
sqrt((b*x - a)*b + a*b)*(2*b*x + 3*a)*sqrt(-b*x + a))*abs(b)/b^2)/b

Mupad [B] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.75 \[ \int \sqrt {x} \sqrt {a-b x} \, dx=\sqrt {x}\,\left (\frac {x}{2}-\frac {a}{4\,b}\right )\,\sqrt {a-b\,x}-\frac {a^2\,\ln \left (a-2\,b\,x+2\,\sqrt {-b}\,\sqrt {x}\,\sqrt {a-b\,x}\right )}{8\,{\left (-b\right )}^{3/2}} \]

[In]

int(x^(1/2)*(a - b*x)^(1/2),x)

[Out]

x^(1/2)*(x/2 - a/(4*b))*(a - b*x)^(1/2) - (a^2*log(a - 2*b*x + 2*(-b)^(1/2)*x^(1/2)*(a - b*x)^(1/2)))/(8*(-b)^
(3/2))